﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="myScheduler.Default" %>




<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
    <link rel="stylesheet" href="~/Style/Style.css" type="text/css" />
     <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <script type="text/javascript">
        $(function () {
            var fall = [
                <%= GetCourseCodes(2) %>
            ];

            var winter = [
                <%= GetCourseCodes(4) %>
            ];


 
            $("#Main_txtCourseCode").autocomplete({
                source: fall
            });

            $("input[name=radGroup]").change(function () {
                if (this.value === "fall") {

                    $("#Main_txtCourseCode").autocomplete({
                        source: fall
                    });
                }
                else {
                    $("#Main_txtCourseCode").autocomplete({
                        source: winter

                    });
                }
            });


        });
        </script>
</asp:Content>


<asp:Content ID="Main" ContentPlaceHolderID="Main" runat="server">
    <!-- Main Page -->

    <!-- Login Box -->
    <div class="content">
        <div class="post">
            <asp:Panel ID="pnlLogin" runat="server">
                Username: <asp:TextBox ID="txtUsername" runat="server" />
                Password: <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
                <asp:Button ID="btnLogin" runat="server" OnClick="btnLogin_onClick" Text="Login" TabIndex="4" />
                <asp:LinkButton ID="lnkRegister" runat="server" PostBackUrl="~/Registration.aspx">Register</asp:LinkButton>
                <div style="clear: both;">&nbsp;
                    <asp:Label ID="lblLogin" forecolor="Red" runat="server" />
                </div>
            </asp:Panel>
            <asp:Panel ID="pnlLogged" runat="server" Visible="false">
                <asp:Button ID="btnLogout" runat="server" Text="Logout" onClick="btnLogout_onClick"/>
                <asp:Button id="btnSaveSehedule" runat="server" text="Save Schedule" OnClick="btnSaveSchedule_onClick" />
                <asp:Button ID="btnReloadSchedule" runat="server" text="Reload Schedule" OnClick="btnReloadSchedule_onClick" />
            </asp:Panel>
        </div>
    </div>

   

    <div class="content">
        <div class="post">
            <h2 class="title">Welcome to myScheduler!</h2>
            <p>Follow the steps in green to begin creating your schedule</p>
  
            <table>
                <tr valign="top">
                    <td width="250">
                        <p class="red" style="color:green;">Step 1</p>
                        <asp:panel ID="pnlSemester" runat="server">
                            Select your semester:<%--<asp:RadioButtonList ID="radSemester" name="radGroup" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="radSemester_SelectedIndexChanged">
                                <asp:ListItem Selected="True">Fall</asp:ListItem>
                                <asp:ListItem>Winter</asp:ListItem>
                            </asp:RadioButtonList>--%>
                            <br />
                            <input type="radio" name="radGroup" value="fall" checked="checked"/>Fall
                            <input type="radio" name="radGroup" value="winter"/>Winter
                        </asp:panel>
                        <asp:Label ID="lblSemester" runat="server" Visible="false"></asp:Label>
                        &nbsp;<div style="clear: both;">&nbsp;</div>
                    </td>
                    <td width="250">
                        <!-- Add Course Box --> 
                        <asp:Panel ID="pnlAddCourse" runat="server" DefaultButton="btnAddCourse">
                            <p class="red"  style="color:green;">Step 2</p>
                            Add A Class:<br /> 
                            <table>
                                <tr>
                                    <td>Course Code</td>
                                    <td><asp:TextBox ID="txtCourseCode" class="ui-autocomplete-input" autocomplete="off" style="text-transform:uppercase;" MaxLength="10" runat="server" BorderColor="#0066FF" BorderWidth="1px" Width="100" ToolTip="Enter Class Code: SOEN"/><br /></td>
                                </tr>
                            </table>
                                
                            <asp:Button ID="btnAddCourse" runat="server" OnClick="btnAddCourse_onClick" Text="Add" Width="123px" TabIndex="1" />
                            <asp:Label ID="lblNotification" runat="server" ForeColor="Red" Text="" /><br />
                        </asp:Panel>
                    </td>
                    <td width="150">
                        <p class="red" style="color:green">Step 3</p>
                        <p class="entry">
                            <asp:Button ID="btnGenerateSchedules" runat="server" Text="Generate Schedules" OnClick="btnGenerateSchedule_onClick" TabIndex="2" />
                        </p>
                    </td>
                </tr>
            </table>                 

            <asp:ScriptManager ID="ScriptManager" runat="server">
                <Services>
                    <asp:ServiceReference Path="~/Webservices/AutoCompleteCourse.asmx" />
                </Services>
            </asp:ScriptManager>
        </div>
    </div>  

</asp:Content>
   
<asp:Content ID="Schedule" ContentPlaceHolderID="Schedule" runat="server">

    <!-- Schedule Display Box -->
        <div class="post">
            <h3 class="current_page_item">Generated Schedules:</h3>
            <div style="clear: both;">&nbsp;</div>
            <div class="entry">
                <asp:Label runat="server" ID="lblGeneratedSchedule"></asp:Label>
            </div>
        </div>
           

 
</asp:Content>               

<asp:Content ID="Content1" runat="server" contentplaceholderid="SideBar">
    <div class="post">
        <p class="red"  style="color:black;">Current Classes</p>
        <asp:CheckBoxList runat="server" style="text-transform:uppercase;" ID="chkCourses"></asp:CheckBoxList>
        <asp:button runat="server" Text="Remove Class" id="btnRemoveCourse" OnClick="btnRemoveCourse_onClick" Visible="false" TabIndex="3" />
        <asp:Label ID="lblCourseListNotification" runat="server" Text="No class added yet"></asp:Label>
        <!--
        <p class="red"  style="color:green;">Step 3</p>
        <p class="entry">
            
            Select additional options: <br />
            
            <asp:DropDownList ID="lstPreferred" runat="server">
                <asp:ListItem>DAYS OFF</asp:ListItem>
                <asp:ListItem>NIGHT</asp:ListItem>
                <asp:ListItem>MORNING</asp:ListItem>
            </asp:DropDownList>
        </p>
        
        <p class="red">Step 4</p>
        <p class="entry">
            <asp:Button ID="btnGenerateSchedule" runat="server" Text="Generate Schedules" OnClick="btnGenerateSchedule_onClick" />
        </p>
        -->
    </div>
       
</asp:Content>
